package com.example.demo.ykj.rainfall.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author zjq
 * @version 创建时间：2022-07-04 15:24:52
 */
@Data
@Entity
@ApiModel(value = "水利雨量数据")
@Table(name = "rainfall")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
public class Rainfall implements Serializable {

    /**
     * GenerationType.IDENTITY在批量插入时无效！！！
     * 主键自增时批量插入无效，数据写入mysql时是一条一条写入
     * 主键为uuid时，数据会批量保存
     */
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(name = "id", nullable = false)
    private String id;

    @ApiModelProperty(value = "水文编码")
    @ExcelProperty(index = 0, value = "水文编码")//这个注解每一个都写，不然读取的数据会错位
    @Column(name = "swbm")
    private String swbm;

    @ApiModelProperty(value = "类型")
    @ExcelProperty(index = 1, value = "类型")
    @Column(name = "lx")
    private String lx;

    @ApiModelProperty(value = "时间")
    @ExcelProperty(index = 2, value = "时间")
    @Column(name = "time")
    private Date time;

    @ApiModelProperty(value = "编码")
    @ExcelProperty(index = 3, value = "编码")
    @Column(name = "bm")
    private String bm;

    @ApiModelProperty(value = "编码*系数")
    @ExcelProperty(index = 4, value = "编码*系数")
    @Column(name = "bmxs")
    private String bmxs;

    @ApiModelProperty(value = "雨量")
    @ExcelProperty(index = 5, value = "雨量")
    @Column(name = "yl")
    private String yl;

}